Skip to content

Conversation

@erica
Copy link
Contributor

@erica erica commented Apr 6, 2016

Within a class scope, Self means "the dynamic class of self". This proposal extends that courtesy to value types, where dynamic Self will match a construct's static type, and to the bodies of class members, where it may not. It also introduces a static variation, #Self that expands to static type of the code it appears within.

This proposal was discussed on the Swift Evolution list in the [Pitch] Adding a Self type name shortcut for static member access thread.

hartbit and others added 30 commits March 4, 2016 18:03
Proposal: SwiftPM System Module Search Paths
Final writeup of the property selector proposal
Update README to move SE-0046 to implemented
…e wrong thread with the wrong title and subsequently corrected.
@erica
Copy link
Contributor Author

erica commented Apr 14, 2016

Updated per Joe Groff's @jckarter suggestions on-list: "It's been pitched before, but I don't think we've had a dedicated thread to this idea. Erica has proposed making Self generally available within methods in types to refer to the dynamic type of the current receiver. One could think of Self as a special associated type member that exists in every type for this purpose. This also happens to be what you get when ask for the dynamicType member of a value. We could unify these concepts and get rid of the clunky dynamicType keyword, replacing it with x.Self."

@erica
Copy link
Contributor Author

erica commented Apr 14, 2016

@jckarter You know what? I seem to have mucked up the pull request process again. Going to try with a clean branch. Watch the pull space. Closing this.

@erica erica closed this Apr 14, 2016
@erica erica deleted the self branch April 14, 2016 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants